package com.xx.service;

import com.xx.api.OrderService;
import com.xx.mapper.OrderMapper;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Seata AT模式
 */
@org.springframework.stereotype.Service
@org.apache.dubbo.config.annotation.Service
@Slf4j
public class ATOrderServiceImpl implements OrderService {

    @Resource
    private OrderMapper orderMapper;

    @GlobalTransactional
    public void update() {
        int update = orderMapper.update();
        log.info("update:{}", update);
    }

    @Override
    public void ttry() {

    }

    @Override
    public void confirm() {

    }

    @Override
    public void cancel() {

    }
}
